/*
 * @Description: 剩余参数
 * @Autor: HuiSir<273250950@qq.com>
 * @Date: 2021-05-06 17:00:46
 * @LastEditTime: 2021-05-06 17:08:52
 */
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
        if (ar || !(i in from)) {
            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
            ar[i] = from[i];
        }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
};
(function () {
    /**
     * args代表剩余参数rest
     * 剩余参数的类型必须是数组
     * 剩余参数必须放在所有形参的最后(剩余参数后面不能再有参数)
     */
    function showMsg(str) {
        var args = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            args[_i - 1] = arguments[_i];
        }
        console.log(str);
        console.log(args);
        console.log.apply(console, __spreadArray([str], args, false));
    }
    showMsg("Hello", "小明", "小红");
    // Hello 
    // ['小明', '小红']
    // Hello 小明 小红
})();
